//
//  SMNetwork.h
//  Sinmore
//
//  Created by huangtie on 2017/2/28.
//  Copyright © 2017年 Sinmore. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface SMNetwork : NSObject

NS_ASSUME_NONNULL_BEGIN

+ (NSURLSessionDataTask *)requestOnGET:(NSString *)URL
                                 param:(NSDictionary *)param
                            completion:(void (^)(NSURLSessionDataTask * _Nullable task, id _Nullable result, NSError * _Nullable error))completion;

+ (NSURLSessionDataTask *)requestOnPOST:(NSString *)URL
                                  param:(NSDictionary *)param
                             completion:(void (^)(NSURLSessionDataTask * _Nullable task, id _Nullable result, NSError * _Nullable error))completion;

+ (NSURLSessionDataTask *)requestOnUpload:(NSString *)URL
                                    param:(NSDictionary *)param
                                    datas:(NSArray <NSData *>* )datas
                               completion:(void (^)(NSURLSessionDataTask * _Nullable task, id _Nullable result, NSError * _Nullable error))completion;

+ (NSURLSessionDataTask *)request:(NSString *)URL
                           method:(NSString *)method
                            param:(NSDictionary *)param
                            datas:(NSArray <NSData *> *)datas
                       completion:(void (^)(NSURLSessionDataTask * _Nullable task, id _Nullable result, NSError * _Nullable error))completion;

NS_ASSUME_NONNULL_END

@end
